<template>
    <view :class="`listBox ${modInfo.mod}list`">
        <view class="quanTip" v-if="(modInfo.mod == 'shop' || modInfo.mod == 'tuan') && !modInfo.state && quan > 0">
            <view class="flex_l"  @click="toQuan">
                <image class="icon" :src="imgpath + 'ring.png?v=' + imgVersion " mode="aspectFit"> </image>
                <view class="txt" v-if="quan > 0">您有{{quan}}张团购券即将过期，请尽快使用！</view>
            </view>
            <view class="flex_r">
                <image class="icon" :src="imgpath + 'arr_shop.png?v=' + imgVersion " mode="aspectFit"> </image>
            </view>
        </view>
        <view class="quanTip" v-if="modInfo.mod == 'paimai' && !modInfo.state">
            <view class="flex_l">
                <image class="icon" :src="imgpath + 'ring.png?v=' + imgVersion " mode="aspectFit"> </image>
                <view class="txt">此页面状态/价格可能延迟，请进入拍品详情查看实时状态</view>
            </view>
           
        </view>
        <view class="listConBox">
            <block v-for="(item,ind) in modInfo.list" :key="item.id">
                <template v-if="modInfo.mod == 'shop'">
                    <orderlist_shop :shopConfig="modConfig.shopConfig" ref="order_shop"  :objInfo="item" :ind="ind"></orderlist_shop>
                </template>
                <template v-else-if="modInfo.mod == 'tuan'">
                    <orderlist_tuan   ref="order_tuan" :tuanConfig="modConfig.tuanConfig"  :objInfo="item" :ind="ind"></orderlist_tuan>
                </template>
                <template v-else-if="modInfo.mod == 'waimai'">
                    <orderlist_waimai ref="order_waimai" :objInfo="item" :ind="ind"></orderlist_waimai>
                </template>
                <template v-else-if="modInfo.mod == 'paotui'">
                    <orderlist_paotui ref="order_paotui" :objInfo="item" :ind="ind"></orderlist_paotui>
                </template>
                <template v-else-if="modInfo.mod == 'travel'">
                    <orderlist_travel ref="order_travel" :travelConfig="modConfig.travelConfig"  :objInfo="item" :ind="ind"></orderlist_travel>
                </template>
                <template v-else-if="modInfo.mod == 'education'">
                    <orderlist_education ref="order_education" :objInfo="item" :ind="ind"></orderlist_education>
                </template>
                <template v-else-if="modInfo.mod == 'homemaking'">
                    <orderlist_homemaking ref="order_homemaking" :objInfo="item" :ind="ind"></orderlist_homemaking>
                </template>
                <template v-else-if="modInfo.mod == 'integral'">
                    <orderlist_integral ref="order_integral" :objInfo="item" :ind="ind"></orderlist_integral>
                </template>
                <template v-else-if="modInfo.mod == 'paimai'">
                    <orderlist_paimai ref="order_paimai" :objInfo="item" :ind="ind"></orderlist_paimai>
                </template>
                <template v-else-if="modInfo.mod == 'huodong'">
                    <orderlist_huodong ref="order_huodong" :objInfo="item" :ind="ind"></orderlist_huodong>
                </template>
                <template v-else-if="modInfo.mod == 'awardlegou'">
                    <orderlist_awardlegou ref="order_awardlegou" :objInfo="item" :ind="ind"></orderlist_awardlegou>
                </template>
            </block>
            <view  :class="{'loadState':true,'noData':modInfo && modInfo.list && modInfo.list.length == 0}">
                <view class="loadEnd" v-if="modInfo.loadEnd">
                    <view class="noData_img" v-if="modInfo.list.length == 0 ">
                        <image :src="`${imgpath}/noData.png?v=${imgVersion}`" mode="aspectFill" />
                    </view>
                    <view class="p">{{ modInfo.list.length ? '已显示全部~' : '暂无相关订单~' }}</view>
                </view>
                <view v-else>{{ modInfo.isload || !modInfo.list ||  modInfo.list.length == 0 ? '加载中...' : '下拉加载更多' }}</view>
            </view>
        </view>

         
    </view>
</template>



<script>

    const app = getApp();
    export default {
        emits:['changestate'],
        props:{
            modInfo:{
                type:Object,
                default:{
                    mod:'',
                    state:'', //状态
                    list:[],
                    isload:false, //正在加载中
                    loadEnd:false, //加载结束
                }
            },
            quan:{
                type:Number,
                default:0
            },
            modConfig:{
                type:Object,
                default:{}
            }
        },
        data(){
            return {
                platForm:app.globalData.platForm,
                imgpath:app.globalData.imgPath + '/member/order/',
                masterDomain:app.globalData.masterDomain,
                imgVersion:app.globalData.imgVersion,
                
            }
        },

        mounted(){
            
        },
        methods:{
            // 跳转用户购物券
            toQuan(){
                const that = this;
                that.$emit('changestate')
            },
           
        }
    }
</script>

<style scoped>
    @import './orderlist.css'
</style>